package wordsDistribution;

import java.util.Comparator;
import java.util.Map;

public class HashBasedComparator implements Comparator<String> {

	private Map<String, Double> map;

	public HashBasedComparator(Map<String, Double> map) {
		this.map = map;
	}

	@Override
	public int compare(String word1, String word2) {
		return Double.compare(map.get(word2),map.get(word1));
	}

}
